//
//  ZpStatusRetweetedView.m
//  WeiBo_OC
//
//  Created by MacBook Pro on 16/5/31.
//  Copyright © 2016年 MacBook Pro. All rights reserved.
//

#import "ZpStatusRetweetedView.h"
#import "ZpPictureCollectionView.h"
@interface ZpStatusRetweetedView ()

@property (nonatomic, strong) UILabel *contentLabel;
@property (nonatomic, strong) ZpPictureCollectionView *pictureView;
@end
@implementation ZpStatusRetweetedView

- (instancetype)init{
    if (self = [super init]) {
        self.backgroundColor = [UIColor darkGrayColor];
        [self addSubview:self.contentLabel];
        [self addSubview:self.pictureView];
    }
    return self;
}

- (void)setRetweeted_status:(ZpStatusViewModel *)retweeted_status{

    _retweeted_status = retweeted_status;
    
    self.contentLabel.text = retweeted_status.status.retweeted_status.text;
    self.pictureView.pics = retweeted_status.status.retweeted_status.pic_urls;
    
    [self.contentLabel makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(self).offset(margin);
        make.right.equalTo(self).offset(-margin);
    }];
    [self.pictureView makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentLabel.bottom).offset(margin);
        make.left.equalTo(self);
        make.bottom.equalTo(self);
    }];
}


- (UILabel *)contentLabel
{
    if (!_contentLabel) {
        _contentLabel = [[UILabel alloc] init];
        _contentLabel.font = [UIFont systemFontOfSize:13];
        _contentLabel.numberOfLines = 0;
        _contentLabel.backgroundColor = [UIColor greenColor];
    }
    return _contentLabel;
}

- (ZpPictureCollectionView *)pictureView{
    if (!_pictureView) {
        _pictureView = [ZpPictureCollectionView pictureCollectionView];
    }
    return _pictureView;
}

@end
